// 创建账号表
// @ts-ignore
await _database_.execute_sql(`
CREATE TABLE "accounts" ( 
    "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
     "username" varchar NOT NULL, 
     "password" varchar NOT NULL, 
     "json_data" text NOT NULL DEFAULT '', 
     CONSTRAINT "idx-user-name" UNIQUE ("username") 
);
`);

// 创建角色表
// @ts-ignore
await _database_.execute_sql(`
CREATE TABLE "characters" (
  "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  "uid" bigint NOT NULL, 
  "characters_name" varchar NOT NULL, 
  "json_data" text NOT NULL DEFAULT '', 
  CONSTRAINT "idx-name" UNIQUE ("characters_name") 
);
`);

// 创建帮派表
// @ts-ignore
await _database_.execute_sql(`
CREATE TABLE "gang" (
  "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  "gang_name" varchar NOT NULL, 
  "json_data" text NOT NULL DEFAULT '', 
  CONSTRAINT "idx-gang-name" UNIQUE ("gang_name") 
);
`);

// 创建帮派表成员表
// @ts-ignore
// await _database_.execute_sql(`
// CREATE TABLE "gang_characters" (
//   "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
//   "gang_id" integer NOT NULL, 
//   "characters_id" integer NOT NULL DEFAULT ''
// );
// `);

// 创建角色任务表
// @ts-ignore
await _database_.execute_sql(`
CREATE TABLE "characters_task" (
  "characters_id" integer NOT NULL,
  "json_data" text NOT NULL DEFAULT ''
);
`);

